import os
import sys

if len(sys.argv) < 3:
    print 'python name_change.py [EXT] [PREFIX]'
    sys.exit()
EXT = sys.argv[1]
PREFIX = sys.argv[2]

for files in os.listdir('./'):
    w = files.split('.')
    ext = w[-1].lower()
    if ext == EXT:
        os.rename(files, PREFIX+'_'+files)
        print files,PREFIX+'_'+files
    